﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using cognysClient.CognyService;

namespace cognysClient.Admin
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            

        }

        //Create Testgroup method
        protected void btnCreateTestGroup_Click(object sender, EventArgs e)
        {
            try
            {

                Testgroup testGroup = new Testgroup();
                var GroupName = tbCreateTestGroup.Text;
                var Description = tbDescription.Text;
                testGroup.Name = GroupName;
                testGroup.Description = Description;

                using (var client = new Service1Client())
                {
                    client.createTestGroup(testGroup);
                }

                tbCreateTestGroup.Text = "";
                tbDescription.Text = "";
                lblCreatedTestGroup.Text = "Ny testgrupp skapad!";
                lblCreatedGroup.Text = "Gruppnamn:";
                lblGroupAnswer.Text = GroupName;
                lblCreatedDescription.Text = "Beskrivning:";
                lblDescriptionAnswer.Text = Description;


            }
            catch
            {

            }
        }
    }
}